﻿using UnityEngine;
using UnityEditor;
using UnityEditor.Extension;
using UnityEditor.UI;
using System;
using System.Extension;
using System.Reflection.Extension;
using System.Reflection;

[CustomEditor(typeof(ActivationBehaviour))]
public class ActivationBehaviourInspector : Editor
{
    SerializedProperty subject, text, makeLast;
    void OnEnable()
    {

        subject = serializedObject.FindProperty("m_subject");
        text = serializedObject.FindProperty("text");
        makeLast = serializedObject.FindProperty("makeLast");
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUILayout.PropertyField(subject);
        EditorGUILayout.PropertyField(text);
        EditorGUILayout.PropertyField(makeLast);
        serializedObject.ApplyModifiedProperties();
    }
       
    [MenuItem("GameObject/UI/Subjective/ActivatorPanel")]
    static void CreateSubjectiveText()
    {
        GameObjectMenu.CreateNewControlInHierarchy("Panel", typeof(ActivationBehaviour));
    }
}
